package com.fintech.third.service.intbank;
import java.sql.Timestamp;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.alibaba.fastjson.JSON;
import com.fintech.third.dao.intbank.IntBankBanruDetailMapper;
import com.fintech.third.dao.intbank.IntBankBasicMapper;
import com.fintech.third.dao.intbank.IntBankCreditCardMapper;
import com.fintech.third.dao.intbank.IntBankCreditPaymentRecordsMapper;
import com.fintech.third.dao.intbank.IntBankCredittipsMapper;
import com.fintech.third.dao.intbank.IntBankDwellmessageMapper;
import com.fintech.third.dao.intbank.IntBankEndowmentInsuranceMapper;
import com.fintech.third.dao.intbank.IntBankGuaranteeCountMapper;
import com.fintech.third.dao.intbank.IntBankLogMapper;
import com.fintech.third.dao.intbank.IntBankNotCredittipsMapper;
import com.fintech.third.dao.intbank.IntBankNotPinshouseholdsMapper;
import com.fintech.third.dao.intbank.IntBankNotQuasiCreditMapper;
import com.fintech.third.dao.intbank.IntBankPositionmesageMapper;
import com.fintech.third.dao.intbank.IntBankQueryDetailMapper;
import com.fintech.third.dao.intbank.IntBankQuerySummaryMapper;
import com.fintech.third.dao.intbank.IntBankStandardCreditCardMapper;
import com.fintech.third.dao.log.IntDataQueryLogMapper;
import com.fintech.third.model.intbank.IntBankBanruDetail;
import com.fintech.third.model.intbank.IntBankBasiInfoCollection;
import com.fintech.third.model.intbank.IntBankBasic;
import com.fintech.third.model.intbank.IntBankCreditCard;
import com.fintech.third.model.intbank.IntBankCreditPaymentRecords;
import com.fintech.third.model.intbank.IntBankCredittips;
import com.fintech.third.model.intbank.IntBankDwellmessage;
import com.fintech.third.model.intbank.IntBankEndowmentInsurance;
import com.fintech.third.model.intbank.IntBankGuaranteeCount;
import com.fintech.third.model.intbank.IntBankLog;
import com.fintech.third.model.intbank.IntBankNotCredittips;
import com.fintech.third.model.intbank.IntBankNotPinshouseholds;
import com.fintech.third.model.intbank.IntBankNotQuasiCredit;
import com.fintech.third.model.intbank.IntBankPositionmesage;
import com.fintech.third.model.intbank.IntBankQueryDetail;
import com.fintech.third.model.intbank.IntBankQuerySummary;
import com.fintech.third.model.intbank.IntBankStandardCreditCard;
import com.fintech.third.model.intlog.IntDataQueryLog;
import com.fintech.third.service.intlog.IntDataQueryLogService;
import com.fintech.third.utils.SerialNumCreater;
import com.marvels.common.utils.MarvelsLogUtil;

@Service("intBankDataInfoService")
public class IntBankDataInfoImpl implements IntBankDataInfoService {
	@Autowired
	private IntBankStandardCreditCardMapper intBankStandardCreditCardMapper;

	@Autowired
	private IntBankEndowmentInsuranceMapper intBankEndowmentInsuranceMapper;

	@Autowired
	private IntBankGuaranteeCountMapper intBankGuaranteeCountMapper;

	@Autowired
	private IntBankNotQuasiCreditMapper intBankNotQuasiCreditMapper;

	@Autowired
	private IntBankNotCredittipsMapper intBankNotCredittipsMapper;

	@Autowired
	private IntBankNotPinshouseholdsMapper intBankNotPinshouseholdsMapper;

	@Autowired
	private IntBankCreditPaymentRecordsMapper intBankCreditPaymentRecordsMapper;

	@Autowired
	private IntBankCreditCardMapper intBankCreditCardMapper;

	@Autowired
	private IntBankBanruDetailMapper intBankBanruDetailMapper;

	@Autowired
	private IntBankQuerySummaryMapper intBankQuerySummaryMapper;

	@Autowired
	private IntBankBasicMapper intBankBasicMapper;

	@Autowired
	private IntBankCredittipsMapper intBankCredittipsMapper;

	@Autowired
	private IntBankPositionmesageMapper intBankPositionmesageMapper;

	@Autowired
	private IntBankQueryDetailMapper intBankQueryDetailMapper;
	@Autowired
	private IntBankDwellmessageMapper intBankDwellmessageMapper;
	
	@Autowired
	private IntDataQueryLogService intDataQueryLogService;

	@Autowired
	private IntBankLogMapper intBankLogMapper;
	
	@Autowired
	private IntDataQueryLogMapper intDataQueryLogMapper;
	
	@Override
	public Map<String, Object> submitStatePositionData(Map<String, String> map) {
		Map<String, Object> dataMap = new HashMap<>();
		String serialNum = map.get("serialNum");
		List<IntBankBasic>	intBankBasic = intBankBasicMapper.intBankBasic(serialNum);
		List<IntBankCredittips> intBankCredittips = intBankCredittipsMapper.intBankCredittips(serialNum);
		List<IntBankCreditCard> intBankCreditCard = intBankCreditCardMapper.intBankCreditCard(serialNum);
		List<IntBankCreditPaymentRecords> intBankCreditPaymentRecords = intBankCreditPaymentRecordsMapper
				.intBankCreditPaymentNJQRecords(serialNum);
		List<IntBankDwellmessage> intBankDwellmessage = intBankDwellmessageMapper.intBankDwellmessage(serialNum);
		List<IntBankEndowmentInsurance> intBankEndowmentInsurance = intBankEndowmentInsuranceMapper
				.intBankEndowmentInsurance(serialNum);
		List<IntBankNotCredittips> intBankNotCredittips = intBankNotCredittipsMapper.intBankNotCredittips(serialNum);
		List<IntBankNotPinshouseholds> intBankNotPinshouseholds = intBankNotPinshouseholdsMapper
				.intBankNotPinshouseholds(serialNum);
		List<IntBankNotQuasiCredit> intBankNotQuasiCredit = intBankNotQuasiCreditMapper
				.intBankNotQuasiCredit(serialNum);
		List<IntBankPositionmesage> intBankPositionmesage = intBankPositionmesageMapper
				.intBankPositionmesage(serialNum);
		List<IntBankQueryDetail> intBankQueryDetail = intBankQueryDetailMapper.intBankQueryDetail(serialNum);
		List<IntBankQuerySummary> intBankQuerySummary = intBankQuerySummaryMapper.intBankQuerySummary(serialNum);
		List<IntBankBanruDetail> intBankBanruDetail = intBankBanruDetailMapper.intBankBanruDetail(serialNum);
		List<IntBankStandardCreditCard> intBankStandardCreditCards = intBankStandardCreditCardMapper
				.intBankStandardCreditCard(serialNum);
		dataMap.put("intBankBasic", intBankBasic);
		dataMap.put("intBankCredittips", intBankCredittips);
		dataMap.put("intBankCreditCard", intBankCreditCard);
		dataMap.put("intBankCreditPaymentRecords", intBankCreditPaymentRecords);
		dataMap.put("intBankDwellmessage", intBankDwellmessage);
		dataMap.put("intBankEndowmentInsurance", intBankEndowmentInsurance);
		dataMap.put("intBankNotCredittips", intBankNotCredittips);
		dataMap.put("intBankNotPinshouseholds", intBankNotPinshouseholds);
		dataMap.put("intBankNotQuasiCredit", intBankNotQuasiCredit);
		dataMap.put("intBankPositionmesage", intBankPositionmesage);
		dataMap.put("intBankQueryDetail", intBankQueryDetail);
		dataMap.put("intBankQuerySummary", intBankQuerySummary);
		dataMap.put("intBankBanruDetail", intBankBanruDetail);
		dataMap.put("intBankStandardCreditCards", intBankStandardCreditCards);
		return dataMap;
	}
	
	@Override
	public IntBankBasiInfoCollection getMarvelsCreditReportData(Map<String, String> map) {
		MarvelsLogUtil.getInstance().info("【getMarvelsCreditReportData】 map = "+map);
//		String serialNum = getMarvelsSerialNum(map);
//		if(StringUtils.isNotEmpty(serialNum)){
//			map.put("serialNum",serialNum);
//		}
		map.put("serialNum",map.get("loanId"));
//		MarvelsLogUtil.getInstance().info("【getMarvelsCreditReportData】 serialNum = "+serialNum);
		Map<String, Object> dataMap = new HashMap<>();
		IntBankBasiInfoCollection intBankBasiInfoCollection = new IntBankBasiInfoCollection();
		//个人基本信息
		List<IntBankBasic> intBankBasic= intBankBasic(map);
		if(CollectionUtils.isNotEmpty(intBankBasic)){
			intBankBasiInfoCollection.setIntBankBasic(intBankBasic.get(0));
		}
		//居住与职业信息
		List<IntBankDwellmessage> intBankDwellmessage = intBankDwellmessage(map);
		List<IntBankPositionmesage> intBankPositionmesage= intBankPositionmesage(map);
		intBankBasiInfoCollection.setIntBankDwellmessageList(intBankDwellmessage);
		intBankBasiInfoCollection.setIntBankPositionmesageList(intBankPositionmesage);
		//信息概要
		setSummaryInformationData(map,intBankBasiInfoCollection);
		//贷款
		setBankCreditPaymentRecords(map, intBankBasiInfoCollection);
		//贷记卡
		setBankCreditCard(map, intBankBasiInfoCollection);
		//准贷记卡
		List<IntBankStandardCreditCard> intBankStandardCreditCard = intBankStandardCreditCard(map);
		intBankBasiInfoCollection.setIntBankStandardCreditCardsList(intBankStandardCreditCard);
		//公共信息明细
		List<IntBankEndowmentInsurance> intBankEndowmentInsurance= intBankEndowmentInsurance(map);
		if(CollectionUtils.isNotEmpty(intBankEndowmentInsurance)){
			intBankBasiInfoCollection.setIntBankEndowmentInsurance(intBankEndowmentInsurance.get(0));
		}
		//查询记录
		setQueryDetailPositionData(map, intBankBasiInfoCollection);
		//个人查询记录
		List<IntBankBanruDetail> intBankBanruDetail= intBankBanruDetail(map);
		intBankBasiInfoCollection.setIntBankBanruDetailList(intBankBanruDetail);
		return intBankBasiInfoCollection;
	}
	
	/**
	 * 获取征信报告提交后变更的serialnum
	 * 场景：新核心征信报告提交时，这边更新后，在新核心流转到征信前置时异常，通过loanid无法再查询到报告数据
	 * @param map
	 * @return
	 */
	private String getMarvelsSerialNum(Map<String, String> map){
		String loanId = map.get("loanId");
		String serialNum = map.get("serialNum");
		if(StringUtils.isNotEmpty(loanId) && StringUtils.isEmpty(serialNum)){
			serialNum = intDataQueryLogMapper.selectMarvelsSerialNum(loanId);
		}
		return serialNum;
	}
	
	@Transactional(propagation=Propagation.REQUIRED,rollbackFor=Exception.class)
	@Override
	public Map<String,String> saveMarvelsCreditReport(String loanId) throws Exception{
		Map<String,String> result = new HashMap<String,String>();
		try{
			String serialNum = SerialNumCreater.creater("HQ", loanId);
			Timestamp date = new Timestamp(System.currentTimeMillis());
			MarvelsLogUtil.getInstance().info("-----------submitState--------------1111-----" + loanId);
			IntDataQueryLog intDataQueryLog = new IntDataQueryLog();
			intDataQueryLog.setLoanId(loanId);
			intDataQueryLog.setSerialNum(serialNum);
			intDataQueryLog.setRequestTime(date);
			intDataQueryLog.setResponseTime(date);
			intDataQueryLog.setResponseCode("100000");
			intDataQueryLog.setChannel("BOMN");
			MarvelsLogUtil.getInstance().info("-----------submitState--------------2222-----" + loanId);
			intDataQueryLogService.insertDataLog(intDataQueryLog);
			MarvelsLogUtil.getInstance().info("-----------submitState--------------44444-----" + loanId);
			Map<String, String> map = new HashMap<>();
			map.put("serialNum", loanId);
			Map<String, Object> dataMap = submitStatePositionData(map);
			Object intBankBasicObj = dataMap.get("intBankBasic");
			List<IntBankBasic> basic = null;
			if (intBankBasicObj != null) {
				basic = (List<IntBankBasic>) intBankBasicObj;
			}
			// List<IntBankBasic> basic = genericDao.findBy(IntBankBasic.class,
			// "serialNum", loan);
			if (basic != null && basic.size() != 0) {
				for (IntBankBasic bankBasic : basic) {
					bankBasic.setSerialNum(serialNum);
					updateIntBankBasic(bankBasic);
				}
			}
			Object intBankCredittipsObj = dataMap.get("intBankCredittips");
			List<IntBankCredittips> credittips = null;
			if (intBankCredittipsObj != null) {
				credittips = (List<IntBankCredittips>) intBankCredittipsObj;
			}
			// List<IntBankCredittips> credittips =
			// genericDao.findBy(IntBankCredittips.class, "serialNum", loan);
			if (credittips != null && credittips.size() != 0) {
				for (IntBankCredittips bankBasic : credittips) {
					bankBasic.setSerialNum(serialNum);
					// genericDao.update(bankBasic);
					updateIntBankCredittips(bankBasic);
				}
			}
			// List<IntBankCreditCard> creditCard =
			// genericDao.findBy(IntBankCreditCard.class, "serialNum", loan);
			Object intBankCreditCardObj = dataMap.get("intBankCreditCard");
			List<IntBankCreditCard> creditCard = null;
			if (intBankCreditCardObj != null) {
				creditCard = (List<IntBankCreditCard>) intBankCreditCardObj;
			}
			if (creditCard != null && creditCard.size() != 0) {
				for (IntBankCreditCard bankBasic : creditCard) {
					bankBasic.setSerialNum(serialNum);
					// genericDao.update(bankBasic);
					updateIntBankCreditCard(bankBasic);
				}
			}
			Object intBankCreditPaymentRecordsObj = dataMap.get("intBankCreditPaymentRecords");
			List<IntBankCreditPaymentRecords> creditPaymentRecords = null;
			if (intBankCreditPaymentRecordsObj != null) {
				creditPaymentRecords = (List<IntBankCreditPaymentRecords>) intBankCreditPaymentRecordsObj;
			}
			// List<IntBankCreditPaymentRecords> creditPaymentRecords =
			// genericDao.findBy(IntBankCreditPaymentRecords.class, "serialNum",
			// loan);
			if (creditPaymentRecords != null && creditPaymentRecords.size() != 0) {
				for (IntBankCreditPaymentRecords bankBasic : creditPaymentRecords) {
					bankBasic.setSerialNum(serialNum);
					updateIntBankCreditPaymentRecords(bankBasic);
					// genericDao.update(bankBasic);
				}
			}

			Object intBankDwellmessageObj = dataMap.get("intBankDwellmessage");
			List<IntBankDwellmessage> dwellmessage = null;
			if (intBankDwellmessageObj != null) {
				dwellmessage = (List<IntBankDwellmessage>) intBankDwellmessageObj;
			}

			// List<IntBankDwellmessage> dwellmessage =
			// genericDao.findBy(IntBankDwellmessage.class, "serialNum", loan);
			if (dwellmessage != null && dwellmessage.size() != 0) {
				for (IntBankDwellmessage bankBasic : dwellmessage) {
					bankBasic.setSerialNum(serialNum);
					// genericDao.update(bankBasic);
					updateIntBankDwellmessage(bankBasic);
				}
			}
			// List<IntBankEndowmentInsurance> endowment =
			// genericDao.findBy(IntBankEndowmentInsurance.class, "serialNum",
			// loan);
			Object intBankEndowmentInsuranceObj = dataMap.get("intBankEndowmentInsurance");
			List<IntBankEndowmentInsurance> endowment = null;
			if (intBankEndowmentInsuranceObj != null) {
				endowment = (List<IntBankEndowmentInsurance>) intBankEndowmentInsuranceObj;
			}
			if (endowment != null && endowment.size() != 0) {
				for (IntBankEndowmentInsurance bankBasic : endowment) {
					bankBasic.setSerialNum(serialNum);
					// genericDao.update(bankBasic);
					updateIntBankEndowmentInsurance(bankBasic);
				}
			}

			// List<IntBankNotCredittips> notCredittips =
			// genericDao.findBy(IntBankNotCredittips.class, "serialNum", loan);
			Object intBankNotCredittipsObj = dataMap.get("intBankNotCredittips");
			List<IntBankNotCredittips> notCredittips = null;
			if (intBankNotCredittipsObj != null) {
				notCredittips = (List<IntBankNotCredittips>) intBankNotCredittipsObj;
			}
			if (notCredittips != null && notCredittips.size() != 0) {
				for (IntBankNotCredittips bankBasic : notCredittips) {
					bankBasic.setSerialNum(serialNum);
					updateIntBankNotCredittips(bankBasic);
					// genericDao.update(bankBasic);
				}
			}

			Object intBankNotPinshouseholdsObj = dataMap.get("intBankNotPinshouseholds");
			List<IntBankNotPinshouseholds> notPinshouseholds = null;
			if (intBankNotPinshouseholdsObj != null) {
				notPinshouseholds = (List<IntBankNotPinshouseholds>) intBankNotPinshouseholdsObj;
			}
			// List<IntBankNotPinshouseholds> notPinshouseholds =
			// genericDao.findBy(IntBankNotPinshouseholds.class, "serialNum", loan);
			if (notPinshouseholds != null && notPinshouseholds.size() != 0) {
				for (IntBankNotPinshouseholds bankBasic : notPinshouseholds) {
					bankBasic.setSerialNum(serialNum);
					// genericDao.update(bankBasic);
					updateIntBankNotPinshouseholds(bankBasic);
				}
			}
			// List<IntBankNotQuasiCredit> notQuasiCredits =
			// genericDao.findBy(IntBankNotQuasiCredit.class, "serialNum", loan);
			Object intBankNotQuasiCreditObj = dataMap.get("intBankNotQuasiCredit");
			List<IntBankNotQuasiCredit> notQuasiCredits = null;
			if (intBankNotQuasiCreditObj != null) {
				notQuasiCredits = (List<IntBankNotQuasiCredit>) intBankNotQuasiCreditObj;
			}
			if (notQuasiCredits != null && notQuasiCredits.size() != 0) {
				for (IntBankNotQuasiCredit bankBasic : notQuasiCredits) {
					bankBasic.setSerialNum(serialNum);
					// genericDao.update(bankBasic);
					updateIntBankNotQuasiCredit(bankBasic);
				}
			}

			Object intBankPositionmesageObj = dataMap.get("intBankPositionmesage");
			List<IntBankPositionmesage> positionmesages = null;
			if (intBankPositionmesageObj != null) {
				positionmesages = (List<IntBankPositionmesage>) intBankPositionmesageObj;
			}
			// List<IntBankPositionmesage> positionmesages =
			// genericDao.findBy(IntBankPositionmesage.class, "serialNum", loan);
			if (positionmesages != null && positionmesages.size() != 0) {
				for (IntBankPositionmesage bankBasic : positionmesages) {
					bankBasic.setSerialNum(serialNum);
					// genericDao.update(bankBasic);
					updateIntBankPositionmesage(bankBasic);
				}
			}

			Object intBankQueryDetailObj = dataMap.get("intBankQueryDetail");
			List<IntBankQueryDetail> queryDetails = null;
			if (intBankQueryDetailObj != null) {
				queryDetails = (List<IntBankQueryDetail>) intBankQueryDetailObj;
			}
			// List<IntBankQueryDetail> queryDetails =
			// genericDao.findBy(IntBankQueryDetail.class, "serialNum", loan);
			if (queryDetails != null && queryDetails.size() != 0) {
				for (IntBankQueryDetail bankBasic : queryDetails) {
					bankBasic.setSerialNum(serialNum);
					// genericDao.update(bankBasic);
					updateIntBankQueryDetail(bankBasic);
				}
			}

			Object intBankQuerySummaryObj = dataMap.get("intBankQuerySummary");
			List<IntBankQuerySummary> querySummaries = null;
			if (intBankQuerySummaryObj != null) {
				querySummaries = (List<IntBankQuerySummary>) intBankQuerySummaryObj;
			}
			// List<IntBankQuerySummary> querySummaries =
			// genericDao.findBy(IntBankQuerySummary.class, "serialNum", loan);
			if (querySummaries != null && querySummaries.size() != 0) {
				for (IntBankQuerySummary bankBasic : querySummaries) {
					bankBasic.setSerialNum(serialNum);
					updateIntBankQuerySummary(bankBasic);
					// genericDao.update(bankBasic);
				}
			}

			Object intBankBanruDetailObj = dataMap.get("intBankBanruDetail");
			List<IntBankBanruDetail> banruDetail = null;
			if (intBankBanruDetailObj != null) {
				banruDetail = (List<IntBankBanruDetail>) intBankBanruDetailObj;
			}
			// List<IntBankBanruDetail> banruDetail =
			// genericDao.findBy(IntBankBanruDetail.class, "serialNum", loan);
			if (banruDetail != null && banruDetail.size() != 0) {
				for (IntBankBanruDetail bankBasic : banruDetail) {
					bankBasic.setSerialNum(serialNum);
					updateIntBankBanruDetail(bankBasic);
					// genericDao.update(BanruDetail);
				}
			}

			Object intBankStandardCreditCardObj = dataMap.get("intBankStandardCreditCard");
			List<IntBankStandardCreditCard> standardCreditCards = null;
			if (intBankStandardCreditCardObj != null) {
				standardCreditCards = (List<IntBankStandardCreditCard>) intBankStandardCreditCardObj;
			}
			// List<IntBankStandardCreditCard> standardCreditCards =
			// genericDao.findBy(IntBankStandardCreditCard.class, "serialNum",
			// loan);
			if (standardCreditCards != null && standardCreditCards.size() != 0) {
				for (IntBankStandardCreditCard bankBasic : standardCreditCards) {
					bankBasic.setSerialNum(serialNum);
					updateIntBankStandardCreditCard(bankBasic);
					// genericDao.update(bankBasic);
				}
			}
			result.put("code", "success");
		}catch(Exception e){
			MarvelsLogUtil.getInstance().error("新核心征信报告核录-提交保存信息异常：", e);
			throw new Exception("新核心征信报告核录-提交保存信息异常：",e);
		}
		return result;
	}
	
	@Override
	public List<IntBankCreditPaymentRecords> saveMarvelsIntBankCreditPaymentRecord(IntBankCreditPaymentRecords intBankCreditPaymentRecord){
		MarvelsLogUtil.getInstance().info("【saveMarvelsIntBankCreditPaymentRecord】 intBankCreditPaymentRecord = "+JSON.toJSONString(intBankCreditPaymentRecord));
		saveIntBankCreditPaymentRecords(intBankCreditPaymentRecord);
		Map<String, String> map=new HashMap<>();
		map.put("serialNum", intBankCreditPaymentRecord.getLoanId());
		Map<String, Object> data= intBankCreditPaymentRecords(map);
		Object intBankCreditPaymentNJQRecords=data.get("intBankCreditPaymentNJQRecords");
		List<IntBankCreditPaymentRecords> intBankCreditPaymentNJQ =null;
		if(intBankCreditPaymentNJQRecords!=null){
			intBankCreditPaymentNJQ=(List<IntBankCreditPaymentRecords>)intBankCreditPaymentNJQRecords;
		}
		return intBankCreditPaymentNJQ;
	}
	
	/**
	 * 查询记录
	 * @param map
	 * @param dataMap
	 */
	private void setQueryDetailPositionData(Map<String, String> map,IntBankBasiInfoCollection intBankBasiInfoCollection){
		Map<String,Object> data= addQueryDetailPositionData(map);
		Object intBankQuerySummaryObj=data.get("intBankQuerySummary");
		List<IntBankQuerySummary> intBankQuerySummary = null;
		if(intBankQuerySummaryObj != null){
			intBankQuerySummary =(List<IntBankQuerySummary>)intBankQuerySummaryObj;
			if(CollectionUtils.isNotEmpty(intBankQuerySummary)){
//				dataMap.put("intBankQuerySummary", intBankQuerySummary.get(0));
				intBankBasiInfoCollection.setIntBankQuerySummary(intBankQuerySummary.get(0));
			}
		}
		
		Object intBankQueryDetailObj=data.get("intBankQueryDetail");
		List<IntBankQueryDetail> intBankQueryDetail = null;
		if(intBankQueryDetailObj != null){
			intBankQueryDetail =(List<IntBankQueryDetail>)intBankQueryDetailObj;
//			dataMap.put("intBankQueryDetail", intBankQueryDetail);
			intBankBasiInfoCollection.setIntBankQueryDetailList(intBankQueryDetail);
		}
	}
	
	/**
	 * 贷记卡
	 * @param map
	 * @param dataMap
	 */
	private void setBankCreditCard(Map<String, String> map,IntBankBasiInfoCollection intBankBasiInfoCollection){
		Map<String, Object> data= intBankCreditCard(map);
		Object intBankCreditCardNXh=data.get("intBankCreditCardNXh");
		List<IntBankCreditCard> intBankCreditCardNXhRecord =null;
		if(intBankCreditCardNXh!=null){
			intBankCreditCardNXhRecord=(List<IntBankCreditCard>)intBankCreditCardNXh;
//			dataMap.put("intBankCreditCardNXhRecord", intBankCreditCardNXhRecord);
			intBankBasiInfoCollection.setIntBankCreditCardNXhRecordList(intBankCreditCardNXhRecord);
		}
		
		Object intBankCreditCardXh=data.get("intBankCreditCardXh");
		List<IntBankCreditCard> intBankCreditCardXhRecord =null;
		if(intBankCreditCardXh!=null){
			intBankCreditCardXhRecord=(List<IntBankCreditCard>)intBankCreditCardXh;
//			dataMap.put("intBankCreditCardXhRecord", intBankCreditCardXhRecord);
			intBankBasiInfoCollection.setIntBankCreditCardXhRecordList(intBankCreditCardXhRecord);
		}
	}
	
	/**
	 * 贷款
	 * @param map
	 * @param dataMap
	 */
	private void setBankCreditPaymentRecords(Map<String, String> map,IntBankBasiInfoCollection intBankBasiInfoCollection){
		Map<String, Object> data= intBankCreditPaymentRecords(map);
		Object intBankCreditPaymentNJQRecords=data.get("intBankCreditPaymentNJQRecords");
		List<IntBankCreditPaymentRecords> intBankCreditPaymentNJQ =null;
		if(intBankCreditPaymentNJQRecords!=null){
			intBankCreditPaymentNJQ=(List<IntBankCreditPaymentRecords>)intBankCreditPaymentNJQRecords;
		}
//		dataMap.put("intBankCreditPaymentNJQ", intBankCreditPaymentNJQ);
		intBankBasiInfoCollection.setIntBankCreditPaymentNJQList(intBankCreditPaymentNJQ);
		
		Object intBankCreditPaymentJQRecords=data.get("intBankCreditPaymentJQRecords");
		List<IntBankCreditPaymentRecords> intBankCreditPaymentJQ =null;
		if(intBankCreditPaymentJQRecords!=null){
			intBankCreditPaymentJQ=(List<IntBankCreditPaymentRecords>)intBankCreditPaymentJQRecords;
		}
//		dataMap.put("intBankCreditPaymentJQ", intBankCreditPaymentJQ);
		intBankBasiInfoCollection.setIntBankCreditPaymentJQList(intBankCreditPaymentJQ);
	}
	
	/**
	 * 信息概要
	 * @param map
	 * @param dataMap
	 */
	private void setSummaryInformationData(Map<String, String> map,IntBankBasiInfoCollection intBankBasiInfoCollection){
		Map<String, Object> data= summaryInformationData(map);
		Object intBankCredittipsObj=data.get("intBankCredittips");
		List<IntBankCredittips> intBankCredittips =null;
		if(intBankCredittipsObj != null){
			intBankCredittips =(List<IntBankCredittips>)intBankCredittipsObj;
			if(CollectionUtils.isNotEmpty(intBankCredittips)){
//				dataMap.put("intBankCredittips", intBankCredittips.get(0));
				intBankBasiInfoCollection.setIntBankCredittips(intBankCredittips.get(0));
			}
		}
		
		Object intBankNotCredittipsObj=data.get("intBankNotCredittips");
		List<IntBankNotCredittips> intBankNotCredittips = null;
		if(intBankNotCredittipsObj != null){
			intBankNotCredittips =(List<IntBankNotCredittips>)intBankNotCredittipsObj;
			if(CollectionUtils.isNotEmpty(intBankNotCredittips)){
//				dataMap.put("intBankNotCredittips", intBankNotCredittips.get(0));
				intBankBasiInfoCollection.setIntBankNotCredittips(intBankNotCredittips.get(0));
			}
		}
		
		Object intBankNotQuasiCreditObj=data.get("intBankNotQuasiCredit");
		List<IntBankNotQuasiCredit> intBankNotQuasiCredit = null;
		if(intBankNotQuasiCreditObj != null){
			intBankNotQuasiCredit =(List<IntBankNotQuasiCredit>)intBankNotQuasiCreditObj;
			if(CollectionUtils.isNotEmpty(intBankNotQuasiCredit)){
//				dataMap.put("intBankNotQuasiCredit", intBankNotQuasiCredit.get(0));
				intBankBasiInfoCollection.setIntBankNotQuasiCredit(intBankNotQuasiCredit.get(0));
			}
		}
		
		
		Object intBankNotPinshouseholdsObj=data.get("intBankNotPinshouseholds");
		List<IntBankNotPinshouseholds> intBankNotPinshouseholds = null;
		if(intBankNotPinshouseholdsObj != null){
			intBankNotPinshouseholds =(List<IntBankNotPinshouseholds>)intBankNotPinshouseholdsObj;
			if(CollectionUtils.isNotEmpty(intBankNotPinshouseholds)){
//				dataMap.put("intBankNotPinshouseholds", intBankNotPinshouseholds.get(0));
				intBankBasiInfoCollection.setIntBankNotPinshouseholds(intBankNotPinshouseholds.get(0));
			}
		}
		
		List<IntBankGuaranteeCount> intBankGuaranteeCount= intBankGuaranteeCount(map);
		if(CollectionUtils.isNotEmpty(intBankGuaranteeCount)){
//			dataMap.put("intBankGuaranteeCount", intBankGuaranteeCount.get(0));
			intBankBasiInfoCollection.setIntBankGuaranteeCount(intBankGuaranteeCount.get(0));
		}
	}

	@Override
	public Map<String, Object> intBankCreditPaymentRecords(Map<String, String> map) {
		Map<String, Object> dataMap = new HashMap<>();
		String serialNum = map.get("serialNum");
		List<IntBankCreditPaymentRecords> intBankCreditPaymentNJQRecords = intBankCreditPaymentRecordsMapper
				.intBankCreditPaymentNJQRecords(serialNum);
		List<IntBankCreditPaymentRecords> intBankCreditPaymentJQRecords = intBankCreditPaymentRecordsMapper
				.intBankCreditPaymentJQRecords(serialNum);
		dataMap.put("intBankCreditPaymentNJQRecords", intBankCreditPaymentNJQRecords);
		dataMap.put("intBankCreditPaymentJQRecords", intBankCreditPaymentJQRecords);
		return dataMap;
	}

	@Override
	public Map<String, Object> intBankCreditCard(Map<String, String> map) {
		Map<String, Object> dataMap = new HashMap<>();
		String serialNum = map.get("serialNum");
		List<IntBankCreditCard> intBankCreditCardNXh = intBankCreditCardMapper.intBankCreditCardNXh(serialNum);
		List<IntBankCreditCard> intBankCreditCardXh = intBankCreditCardMapper.intBankCreditCardXh(serialNum);
		dataMap.put("intBankCreditCardNXh", intBankCreditCardNXh);
		dataMap.put("intBankCreditCardXh", intBankCreditCardXh);
		return dataMap;
	}

	@Override
	public List<IntBankStandardCreditCard> intBankStandardCreditCard(Map<String, String> map) {
		String serialNum = map.get("serialNum");
		return intBankStandardCreditCardMapper.intBankStandardCreditCard(serialNum);
	}

	@Override
	public List<IntBankEndowmentInsurance> intBankEndowmentInsurance(Map<String, String> map) {
		String serialNum = map.get("serialNum");
		return intBankEndowmentInsuranceMapper.intBankEndowmentInsurance(serialNum);
	}

	@Override
	public Map<String, Object> summaryInformationData(Map<String, String> map) {
		Map<String, Object> dataMap = new HashMap<>();
		String serialNum = map.get("serialNum");
		List<IntBankCredittips> intBankCredittips = intBankCredittipsMapper.intBankCredittips(serialNum);
		List<IntBankNotCredittips> intBankNotCredittips = intBankNotCredittipsMapper.intBankNotCredittips(serialNum);
		List<IntBankNotQuasiCredit> intBankNotQuasiCredit = intBankNotQuasiCreditMapper
				.intBankNotQuasiCredit(serialNum);
		List<IntBankNotPinshouseholds> intBankNotPinshouseholds = intBankNotPinshouseholdsMapper
				.intBankNotPinshouseholds(serialNum);
		dataMap.put("intBankCredittips", intBankCredittips);
		dataMap.put("intBankNotCredittips", intBankNotCredittips);
		dataMap.put("intBankNotQuasiCredit", intBankNotQuasiCredit);
		dataMap.put("intBankNotPinshouseholds", intBankNotPinshouseholds);
		return dataMap;
	}

	@Override
	public List<IntBankGuaranteeCount> intBankGuaranteeCount(Map<String, String> map) {
		String serialNum = map.get("serialNum");
		return intBankGuaranteeCountMapper.intBankGuaranteeCount(serialNum);
	}

	@Override
	public int saveIntBankStandardCreditCard(IntBankStandardCreditCard intBankStandardCreditCard) {
		return intBankStandardCreditCardMapper.insertSelective(intBankStandardCreditCard);
	}

	@Override
	public int saveIntBankEndowmentInsurance(IntBankEndowmentInsurance intBankEndowmentInsurance) {
		return intBankEndowmentInsuranceMapper.insertSelective(intBankEndowmentInsurance);
	}

	@Override
	public int updateIntBankEndowmentInsurance(IntBankEndowmentInsurance intBankEndowmentInsurance) {
		return intBankEndowmentInsuranceMapper.updateByPrimaryKeySelective(intBankEndowmentInsurance);
	}

	@Override
	public int saveIntBankNotQuasiCredit(IntBankNotQuasiCredit intBankNotQuasiCredit) {
		return intBankNotQuasiCreditMapper.insertSelective(intBankNotQuasiCredit);
	}

	@Override
	public int updateIntBankNotQuasiCredit(IntBankNotQuasiCredit intBankNotQuasiCredit) {
		MarvelsLogUtil.getInstance().info("【updateIntBankNotQuasiCredit】 intBankNotQuasiCredit = "+JSON.toJSONString(intBankNotQuasiCredit));
		return intBankNotQuasiCreditMapper.updateByPrimaryKeySelective(intBankNotQuasiCredit);
	}

	@Override
	public int updateIntBankNotCredittips(IntBankNotCredittips intBankNotCredittips) {
		return intBankNotCredittipsMapper.updateByPrimaryKeySelective(intBankNotCredittips);
	}

	@Override
	public int saveIntBankNotCredittips(IntBankNotCredittips intBankNotCredittips) {
		return intBankNotCredittipsMapper.insertSelective(intBankNotCredittips);
	}

	@Override
	public int updateIntBankGuaranteeCount(IntBankGuaranteeCount intBankGuaranteeCount) {
		return intBankGuaranteeCountMapper.updateByPrimaryKeySelective(intBankGuaranteeCount);
	}

	@Override
	public int saveIntBankGuaranteeCount(IntBankGuaranteeCount intBankGuaranteeCount) {
		return intBankGuaranteeCountMapper.insertSelective(intBankGuaranteeCount);
	}

	@Override
	public int updateIntBankNotPinshouseholds(IntBankNotPinshouseholds intBankNotPinshouseholds) {
		MarvelsLogUtil.getInstance().info("【updateIntBankNotPinshouseholds】 intBankNotPinshouseholds = "+intBankNotPinshouseholds);
		return intBankNotPinshouseholdsMapper.updateByPrimaryKeySelective(intBankNotPinshouseholds);
	}

	@Override
	public int saveIntBankNotPinshouseholds(IntBankNotPinshouseholds intBankNotPinshouseholds) {
		return intBankNotPinshouseholdsMapper.insertSelective(intBankNotPinshouseholds);
	}

	@Override
	public int updateIntBankCreditPaymentRecords(IntBankCreditPaymentRecords intBankCreditPaymentRecords) {
		return intBankCreditPaymentRecordsMapper.updateByPrimaryKeySelective(intBankCreditPaymentRecords);
	}

	@Override
	public int saveIntBankCreditPaymentRecords(IntBankCreditPaymentRecords intBankCreditPaymentRecords) {
		return intBankCreditPaymentRecordsMapper.insertSelective(intBankCreditPaymentRecords);
	}

	@Override
	public int updateIntBankCreditCard(IntBankCreditCard intBankCreditCard) {
		return intBankCreditCardMapper.updateByPrimaryKeySelective(intBankCreditCard);
	}

	@Override
	public int saveIntBankCreditCard(IntBankCreditCard intBankCreditCard) {
		return intBankCreditCardMapper.insertSelective(intBankCreditCard);
	}

	@Override
	public Map<String, Object> addQueryDetailPositionData(Map<String, String> map) {
		Map<String, Object> dataMap = new HashMap<>();
		String serialNum = map.get("serialNum");
		List<IntBankQuerySummary> intBankQuerySummary = intBankQuerySummaryMapper.intBankQuerySummary(serialNum);
		List<IntBankQueryDetail> intBankQueryDetail = intBankQueryDetailMapper.intBankQueryDetail(serialNum);
		dataMap.put("intBankQuerySummary", intBankQuerySummary);
		dataMap.put("intBankQueryDetail", intBankQueryDetail);
		return dataMap;
	}

	@Override
	public int saveIntBankBanruDetail(IntBankBanruDetail intBankBanruDetail) {
		return intBankBanruDetailMapper.insertSelective(intBankBanruDetail);
	}

	@Override
	public int updateIntBankBanruDetail(IntBankBanruDetail intBankBanruDetail) {
		return intBankBanruDetailMapper.updateByPrimaryKeySelective(intBankBanruDetail);
	}

	@Override
	public List<IntBankBanruDetail> intBankBanruDetail(Map<String, String> map) {
		String serialNum = map.get("serialNum");
		return intBankBanruDetailMapper.intBankBanruDetail(serialNum);
	}

	@Override
	public int deleteIntBankQuerySummary(long id) {
		return intBankQuerySummaryMapper.deleteByPrimaryKey(id);
	}

	@Override
	public int saveIntBankQuerySummary(IntBankQuerySummary intBankQuerySummary) {
		return intBankQuerySummaryMapper.insertSelective(intBankQuerySummary);
	}

	@Override
	public int updateIntBankQuerySummary(IntBankQuerySummary intBankQuerySummary) {
		return intBankQuerySummaryMapper.updateByPrimaryKeySelective(intBankQuerySummary);
	}

	@Override
	public int deleteIntBankBanruDetail(long id) {
		return intBankBanruDetailMapper.deleteByPrimaryKey(id);
	}

	@Override
	public int saveIntBankBasic(IntBankBasic intBankBasic) {
		return intBankBasicMapper.insertSelective(intBankBasic);
	}
	
	@Override
	public IntBankBasic saveMarvelsIntBankBasic(IntBankBasic intBankBasic) {
		saveIntBankBasic(intBankBasic);
		Map<String, String> map=new HashMap<>();
		map.put("serialNum", intBankBasic.getLoanId());
		List<IntBankBasic> data= intBankBasic(map);
		if(data!=null && data.size()>0){
			return data.get(0);
		}else{
			return new IntBankBasic();
		}
	}

	@Override
	public int updateIntBankBasic(IntBankBasic intBankBasic) {
		return intBankBasicMapper.updateByPrimaryKeySelective(intBankBasic);
	}

	@Override
	public List<IntBankBasic> intBankBasic(Map<String, String> map) {
		String serialNum = map.get("serialNum");
		List<IntBankBasic> intBankBasic =null;
		if(StringUtils.isNotBlank(serialNum)){
			intBankBasic = intBankBasicMapper.intBankBasic(serialNum);
		}else if(StringUtils.isNotBlank(map.get("loanId"))){
			intBankBasic = intBankBasicMapper.intBankBasicByLoanId(map.get("loanId"));
		}
		return intBankBasic;
	}
	
	@Override
	public int saveIntBankCredittips(IntBankCredittips intBankCredittips) {
		return intBankCredittipsMapper.insertSelective(intBankCredittips);
	}
	
	@Override
	public IntBankCredittips saveMarvelsIntBankCredittips(IntBankCredittips intBankCredittips){
		saveIntBankCredittips(intBankCredittips);
		Map<String, String> map=new HashMap<>();
		map.put("serialNum", intBankCredittips.getLoanId());
		Map<String, Object> dataMap= summaryInformationData(map);
		Object intBankCredittipsObj=dataMap.get("intBankCredittips");
		List<IntBankCredittips> data =null;
		if(intBankCredittipsObj != null){
			data =(List<IntBankCredittips>)intBankCredittipsObj;
			if(CollectionUtils.isNotEmpty(data)){
				return data.get(0);
			}else{
				return new IntBankCredittips();
			}
		}else{
			return new IntBankCredittips();
		}
	}
	
	@Override
	public IntBankNotCredittips saveMarvelsIntBankNotCredittips(IntBankNotCredittips intBankNotCredittips){
		saveIntBankNotCredittips(intBankNotCredittips);
		Map<String, String> map=new HashMap<>();
		map.put("serialNum", intBankNotCredittips.getLoanId());
		Map<String, Object> dataMap= summaryInformationData(map);
		Object obj = dataMap.get("intBankNotCredittips");
		List<IntBankNotCredittips> data =null;
		if(obj != null){
			data =(List<IntBankNotCredittips>)obj;
			if(CollectionUtils.isNotEmpty(data)){
				return data.get(0);
			}else{
				return new IntBankNotCredittips();
			}
		}else{
			return new IntBankNotCredittips();
		}
	}
	
	@Override
	public IntBankNotPinshouseholds saveMarvelsIntBankNotPinshouseholds(IntBankNotPinshouseholds intBankNotPinshouseholds){
		saveIntBankNotPinshouseholds(intBankNotPinshouseholds);
		Map<String, String> map=new HashMap<>();
		map.put("serialNum", intBankNotPinshouseholds.getLoanId());
		Map<String, Object> dataMap= summaryInformationData(map);
		Object obj = dataMap.get("intBankNotPinshouseholds");
		List<IntBankNotPinshouseholds> data =null;
		if(obj != null){
			data =(List<IntBankNotPinshouseholds>)obj;
			if(CollectionUtils.isNotEmpty(data)){
				return data.get(0);
			}else{
				return new IntBankNotPinshouseholds();
			}
		}else{
			return new IntBankNotPinshouseholds();
		}
	}
	
	@Override
	public IntBankNotQuasiCredit saveMarvelsIntBankNotQuasiCredit(IntBankNotQuasiCredit intBankNotQuasiCredit){
		saveIntBankNotQuasiCredit(intBankNotQuasiCredit);
		Map<String, String> map=new HashMap<>();
		map.put("serialNum", intBankNotQuasiCredit.getLoanId());
		Map<String, Object> dataMap= summaryInformationData(map);
		Object obj = dataMap.get("intBankNotQuasiCredit");
		List<IntBankNotQuasiCredit> data =null;
		if(obj != null){
			data =(List<IntBankNotQuasiCredit>)obj;
			if(CollectionUtils.isNotEmpty(data)){
				return data.get(0);
			}else{
				return new IntBankNotQuasiCredit();
			}
		}else{
			return new IntBankNotQuasiCredit();
		}
	}
	
	@Override
	public IntBankGuaranteeCount saveMarvelsIntBankGuaranteeCount(IntBankGuaranteeCount intBankGuaranteeCount){
		saveIntBankGuaranteeCount(intBankGuaranteeCount);
		Map<String, String> map=new HashMap<>();
		map.put("serialNum", intBankGuaranteeCount.getLoanId());
		List<IntBankGuaranteeCount> data = intBankGuaranteeCount(map);
		if(CollectionUtils.isNotEmpty(data)){
			return data.get(0);
		}else{
			return new IntBankGuaranteeCount();
		}
	}
	
	@Override
	public int updateIntBankCredittips(IntBankCredittips intBankCredittips) {
		return intBankCredittipsMapper.updateByPrimaryKeySelective(intBankCredittips);
	}

	@Override
	public List<IntBankCredittips> intBankCredittips(Map<String, String> map) {
		String serialNum = map.get("serialNum");
		return intBankCredittipsMapper.intBankCredittips(serialNum);
	}

	@Override
	public int saveIntBankPositionmesage(IntBankPositionmesage intBankPositionmesage) {
		return intBankPositionmesageMapper.insertSelective(intBankPositionmesage);
	}
	
	@Override
	public IntBankPositionmesage saveMarvelsIntBankPositionmesage(IntBankPositionmesage intBankPositionmesage){
		IntBankPositionmesage data = null;
		if(intBankPositionmesage != null){
			List<IntBankPositionmesage> newList = intBankPositionmesage.getNewList();
			List<IntBankPositionmesage> updateList = intBankPositionmesage.getUpdateList();
			if(CollectionUtils.isNotEmpty(newList)){
				for(IntBankPositionmesage obj : newList){
					obj.setEstablishDate(new Date());
					saveIntBankPositionmesage(obj);
				}
			}
			if(CollectionUtils.isNotEmpty(updateList)){
				for(IntBankPositionmesage obj : updateList){
					updateIntBankPositionmesage(obj);
				}
			}
			Map<String, String> map=new HashMap<>();
			map.put("serialNum", intBankPositionmesage.getLoanId());
			data = new IntBankPositionmesage();
			data.setNewList(intBankPositionmesage(map));
		}
		return data;
	}

	@Override
	public int updateIntBankPositionmesage(IntBankPositionmesage intBankPositionmesage) {
		return intBankPositionmesageMapper.updateByPrimaryKeySelective(intBankPositionmesage);
	}

	@Override
	public List<IntBankPositionmesage> intBankPositionmesage(Map<String, String> map) {
		String serialNum = map.get("serialNum");
		return intBankPositionmesageMapper.intBankPositionmesage(serialNum);
	}

	@Override
	public int saveIntBankDwellmessage(IntBankDwellmessage intBankDwellmessage) {
		return intBankDwellmessageMapper.insertSelective(intBankDwellmessage);
	}

	@Override
	public int updateIntBankDwellmessage(IntBankDwellmessage intBankDwellmessage) {
		return intBankDwellmessageMapper.updateByPrimaryKeySelective(intBankDwellmessage);
	}
	
	@Override
	public IntBankDwellmessage saveMarvelsIntBankDwellmessage(IntBankDwellmessage intBankDwellmessage){
		IntBankDwellmessage data = null;
		if(intBankDwellmessage != null){
			List<IntBankDwellmessage> newList = intBankDwellmessage.getNewList();
			List<IntBankDwellmessage> updateList = intBankDwellmessage.getUpdateList();
			if(CollectionUtils.isNotEmpty(newList)){
				for(IntBankDwellmessage obj : newList){
					obj.setEstablishDate(new Date());
					saveIntBankDwellmessage(obj);
				}
			}
			if(CollectionUtils.isNotEmpty(updateList)){
				for(IntBankDwellmessage obj : updateList){
					updateIntBankDwellmessage(obj);
				}
			}
			Map<String, String> map=new HashMap<>();
			map.put("serialNum", intBankDwellmessage.getLoanId());
			data = new IntBankDwellmessage();
			data.setNewList(intBankDwellmessage(map));
		}
		return data;
	}

	@Override
	public List<IntBankDwellmessage> intBankDwellmessage(Map<String, String> map) {
		String serialNum = map.get("serialNum");
		return intBankDwellmessageMapper.intBankDwellmessage(serialNum);
	}


	@Override
	public int updateIntBankQueryDetail(IntBankQueryDetail intBankQueryDetail) {
		return intBankQueryDetailMapper.updateByPrimaryKeySelective(intBankQueryDetail);
	}

	@Override
	public int updateIntBankStandardCreditCard(IntBankStandardCreditCard intBankStandardCreditCard) {
		return intBankStandardCreditCardMapper.updateByPrimaryKeySelective(intBankStandardCreditCard);
	}

	@Override
	public int insertIntBankLog(IntBankLog intBankLog) {
		return intBankLogMapper.insertSelective(intBankLog);
	}

	@Override
	public Map<String, Object> viewRiskInfoPositionData(Map<String, String> map) {
		Map<String, Object> dataMap=new HashMap<>();
		String loanId = map.get("loanId");
		List<IntBankNotPinshouseholds> intBankNotPinshouseholds=intBankNotPinshouseholdsMapper.intBankNotPinshouseholdsLoanId(loanId);
		List<IntBankCredittips> intBankCredittips=intBankCredittipsMapper.intBankCredittipsLoanId(loanId);
		List<IntBankNotCredittips> intBankNotCredittips=intBankNotCredittipsMapper.intBankNotCredittipsLoanId(loanId);
		dataMap.put("intBankNotPinshouseholds", intBankNotPinshouseholds);
		dataMap.put("intBankCredittips", intBankCredittips);
		dataMap.put("intBankNotCredittips", intBankNotCredittips);
		return dataMap;
	}

	@Override
	public List<IntBankCreditCard> intBankCreditCardLoanId(Map<String, String> map) {
		String loanId = map.get("loanId");
		return intBankCreditCardMapper.intBankCreditCardLoanId(loanId);
	}

	@Override
	public int saveIntBankQueryDetail(IntBankQueryDetail intBankQueryDetail) {
		return intBankQueryDetailMapper.insertSelective(intBankQueryDetail);
	}

	@Override
	public int deleteIntBankQueryDetail(long id) {
		return intBankQueryDetailMapper.deleteByPrimaryKey(id);
	}

	@Override
	public List<IntBankQuerySummary> intBankQuerySummary(Map<String, String> map) {
		String serialNum = map.get("serialNum");
		return intBankQuerySummaryMapper.intBankQuerySummary(serialNum);
	}

	@Override
	public List<Map<String, Object>> detailsOfLoanInformation(Map<String, String> map) {
		String loanId=map.get("loanId");
		return intBankCreditPaymentRecordsMapper.detailsOfLoanInformation(loanId);
	}
	
	
	

}
